#include <iostream>
#include <cmath>
using namespace std;

int main() {
    int n;
    while (cin >> n)
    {
        if (n == 0) break;
        long a = pow(5, n) - 4;
        long b = pow(4, n) - 4 + n;
        cout << a << " " << b << endl;
    }
    return 0;
}